import yamail
import logging
import HTMLTestRunner_PY3

#发送邮件
class tools():
    def youjian(self):
        youjian = yamail.SMTP(user='2940554532@qq.com',password='xwntrbbdrwcadhch',host='smtp.qq.com',port=465)
        youjian.send(to='2076391961@qq.com',subject='张春霞',
                     contents='E:\Django\DjangoProject\PythonProject2\Report\TestCase.html')
        youjian.close()
        print('发送成功')

    #报告
    def baogao(self):
        baogao = HTMLTestRunner_PY3.HTMLTestRunner(open(r'E:\Django\DjangoProject\PythonProject2\Report\TestCase.html','wb'),
                                                   title='测试结果',
                                                   description='报告均通过')
        return baogao